<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div id="content"
     style="height:150px;
     line-height:150px;text-align:center;
     color: #fff;background-color:#ccc;font-size:80px;"></div>
<script>
  let num = 1;
  let content = document.getElementById('content');

  function count() {
    content.innerHTML = num++;
  };
  content.onmousemove = debounce(count,1000);

  function debounce(func, wait) {
    let timeout;

    return function () {
      let context = this;
      let args = arguments;
      // console.log(timeout);
      // console.log(this);
      // console.log(context);
      if (timeout) clearTimeout(timeout);

      timeout = setTimeout(() => {
        func.apply(context, args)
      }, wait);
    }
  }
</script>

</body>
</html>